<template>
	<div class="login">
		<div id="logo">
			<h1 class="hogo"><i>LWB系统管理平台</i></h1>
		</div>
		<section class="stark-login">
			<div class="form">
				<div id="fade-box">
					<input type="text" v-model="username" placeholder="用户名">
					<input type="password" v-model="password" placeholder="密码">
					<button @click="submitBtn">进入系统</button>
				</div>
			</div>
			<div class="hexagons">
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<br><span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<br><span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<br><span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<br><span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
				<span>&#x2B22;</span>
			</div>
		</section>
		<div id="circle1">
			<div id="inner-cirlce1">
				<h2></h2>
			</div>
		</div>
		<ul>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</template>

<script>
	import {
		reactive,
		toRefs,
		defineComponent,
		inject,
		onBeforeMount,
		onUnmounted
	} from 'vue'
	import {
		ElMessage
	} from 'element-plus'
	export default defineComponent({
		setup() {
			const data = reactive({
				username: '',
				password: '',
			})
			const postApi = inject('postApi')
			const getApi = inject('getApi')
			const httpApi = inject('httpApi')
			onBeforeMount(() => {
				console.log(0)
				localStorage.setItem('loginType','0')
			})
			onUnmounted(() => {
				console.log(1)
				localStorage.setItem('loginType','1')
			})
			function submitBtn() {
				// 登录
				console.log(httpApi.selectTypeList)
				if(data.username == ''){
					ElMessage({
						message: '用户名不能为空',
						type: 'success',
					})
					return
				}
				if(data.password == ''){
					ElMessage({
						message: '密码不能为空',
						type: 'success',
					})
					return
				}

				let sj = {username:'treasure',pasword:'123456'}
				postApi('/app/AdmLogin',sj).then( res => {
					console.log('成功' + JSON.stringify(res))
				})
				getApi('/type/getTypeList?mold=0').then( res => {
					console.log('成功' + JSON.stringify(res))
				})
			}

			return {
				...toRefs(data),
				submitBtn
			}
		}
	})
</script>

<style>
	* {
		box-sizing: border-box
	}

	.login {
		/* background: #1c1616; */
		/* height: 100vh; */
	}
	html {
		background: #1c1616;
		background-size: cover;
		font-size: 10px;
		height: 100%;
		overflow: hidden;
		position: absolute;
		text-align: center;
		width: 100%
	}

	#logo {
		animation: logo-entry 4s ease-in;
		width: 500px;
		margin: 10% auto;
		position: relative;
		z-index: 40
	}

	h1.hogo {
		animation: text-glow 2s ease-out infinite alternate;
		font-family: 'Ubuntu', sans-serif;
		color: #00a4a2;
		font-size: 48px;
		font-size: 4.8rem;
		font-weight: bold;
		position: absolute;
		text-shadow: 0 0 10px #1c1616, 0 0 20px #1c1616, 0 0 30px #1c1616, 0 0 40px #1c1616, 0 0 50px #1c1616, 0 0 60px #1c1616, 0 0 70px #1c1616;
		top: 50px
	}

	h1.hogo:before {
		animation: before-glow 2s ease-out infinite alternate;
		border-left: 535px solid transparent;
		border-bottom: 10px solid #00a4a2;
		content: ' ';
		height: 0;
		position: absolute;
		right: -74px;
		top: -10px;
		width: 0
	}

	h1.hogo:after {
		animation: after-glow 2s ease-out infinite alternate;
		border-left: 100px solid transparent;
		border-top: 16px solid #00a4a2;
		content: ' ';
		height: 0;
		position: absolute;
		right: -85px;
		top: 24px;
		transform: rotate(-47deg);
		width: 0
	}

	#fade-box {
		animation: input-entry 3s ease-in;
		z-index: 4
	}

	.stark-login .form {
		animation: form-entry 3s ease-in-out;
		background: #111;
		background: linear-gradient(#004746, #111);
		border: 6px solid #00a4a2;
		box-shadow: 0 0 15px #00fffd;
		border-radius: 5px;
		display: inline-block;
		height: 220px;
		margin: 180px auto 0;
		position: relative;
		z-index: 4;
		width: 500px;
		transition: 1s all
	}

	.stark-login form:hover {
		border: 6px solid #00fffd;
		box-shadow: 0 0 25px #00fffd;
		transition: 1s all
	}

	.stark-login input {
		background: #222;
		background: linear-gradient(#1c1616, #222);
		border: 1px solid #444;
		border-radius: 5px;
		box-shadow: 0 2px 0 #1c1616;
		color: #888;
		display: block;
		font-family: 'Cabin', helvetica, arial, sans-serif;
		font-size: 13px;
		font-size: 1.3rem;
		height: 40px;
		margin: 20px auto 10px;
		padding: 0 10px;
		text-shadow: 0 -1px 0 #1c1616;
		width: 400px
	}

	.stark-login input:focus {
		animation: box-glow 1s ease-out infinite alternate;
		background: #0B4252;
		background: linear-gradient(#1c1616933, #222922);
		border-color: #00fffc;
		box-shadow: 0 0 5px rgba(0, 255, 253, 0.2), inset 0 0 5px rgba(0, 255, 253, 0.1), 0 2px 0 #1c1616;
		color: #efe;
		outline: 0
	}

	.stark-login input:invalid {
		border: 2px solid #1c1616;
		box-shadow: 0 0 5px rgba(255, 0, 0, 0.2), inset 0 0 5px rgba(255, 0, 0, 0.1), 0 2px 0 #1c1616
	}

	.stark-login button {
		animation: input-entry 3s ease-in;
		background: #222;
		background: linear-gradient(#1c1616, #222);
		box-sizing: content-box;
		border: 1px solid #444;
		border-left-color: #1c1616;
		border-radius: 5px;
		box-shadow: 0 2px 0 #1c1616;
		color: #fff;
		display: block;
		font-family: 'Cabin', helvetica, arial, sans-serif;
		font-size: 13px;
		font-weight: 400;
		height: 40px;
		line-height: 40px;
		margin: 20px auto;
		padding: 0;
		position: relative;
		text-shadow: 0 -1px 0 #1c1616;
		width: 400px;
		transition: 1s all
	}

	.stark-login button:hover,
	.stark-login button:focus {
		background: #0C6125;
		background: linear-gradient(#393939, #292929);
		color: #00fffc;
		outline: 0;
		transition: 1s all
	}

	.stark-login button:active {
		background: #292929;
		background: linear-gradient(#393939, #292929);
		box-shadow: 0 1px 0 #1c1616, inset 1px 0 1px #222;
		top: 1px
	}

	#circle1 {
		animation: circle1 4s linear infinite, circle-entry 6s ease-in-out;
		background: #1c1616;
		border-radius: 50%;
		border: 10px solid #00a4a2;
		box-shadow: 0 0 0 2px black, 0 0 0 6px #00fffc;
		height: 500px;
		width: 500px;
		position: absolute;
		top: 18%;
		left: 50%;
		margin-left: -250px;
		overflow: hidden;
		opacity: .4;
		z-index: -3
	}

	#inner-cirlce1 {
		background: #1c1616;
		border-radius: 50%;
		border: 36px solid #00fffc;
		height: 460px;
		width: 460px;
		margin: 10px
	}

	#inner-cirlce1:before {
		content: ' ';
		width: 240px;
		height: 480px;
		background: #1c1616;
		position: absolute;
		top: 0;
		left: 0
	}

	#inner-cirlce1:after {
		content: ' ';
		width: 480px;
		height: 240px;
		background: #1c1616;
		position: absolute;
		top: 0;
		left: 0
	}

	.hexagons {
		animation: logo-entry 4s ease-in;
		color: #1c1616;
		font-size: 52px;
		font-size: 5.1rem;
		letter-spacing: -0.2em;
		line-height: .7;
		position: absolute;
		text-shadow: 0 0 6px #00fffc;
		top: 440px;
		width: 100%;
		transform: perspective(600px) rotateX(60deg) scale(1.4);
		z-index: -3
	}

	@keyframes logo-entry {
		0% {
			opacity: 0
		}

		80% {
			opacity: 0
		}

		100% {
			opacity: 1
		}
	}

	@keyframes circle-entry {
		0% {
			opacity: 0
		}

		20% {
			opacity: 0
		}

		100% {
			opacity: .4
		}
	}

	@keyframes input-entry {
		0% {
			opacity: 0
		}

		90% {
			opacity: 0
		}

		100% {
			opacity: 1
		}
	}

	@keyframes form-entry {
		0% {
			height: 0;
			width: 0;
			opacity: 0;
			padding: 0
		}

		20% {
			height: 0;
			border: 1px solid #00a4a2;
			width: 0;
			opacity: 0;
			padding: 0
		}

		40% {
			width: 0;
			height: 220px;
			border: 6px solid #00a4a2;
			opacity: 1;
			padding: 0
		}

		100% {
			height: 220px;
			width: 500px
		}
	}

	@keyframes box-glow {
		0% {
			border-color: #00b8b6;
			box-shadow: 0 0 5px rgba(0, 255, 253, 0.2), inset 0 0 5px rgba(0, 255, 253, 0.1), 0 2px 0 #1c1616
		}

		100% {
			border-color: #00fffc;
			box-shadow: 0 0 20px rgba(0, 255, 253, 0.6), inset 0 0 10px rgba(0, 255, 253, 0.4), 0 2px 0 #1c1616
		}
	}

	@keyframes text-glow {
		0% {
			color: #00a4a2;
			text-shadow: 0 0 10px #1c1616, 0 0 20px #1c1616, 0 0 30px #1c1616, 0 0 40px #1c1616, 0 0 50px #1c1616, 0 0 60px #1c1616, 0 0 70px #1c1616
		}

		100% {
			color: #00fffc;
			text-shadow: 0 0 20px rgba(0, 255, 253, 0.6), 0 0 10px rgba(0, 255, 253, 0.4), 0 2px 0 #1c1616
		}
	}

	@keyframes before-glow {
		0% {
			border-bottom: 10px solid #00a4a2
		}

		100% {
			border-bottom: 10px solid #00fffc
		}
	}

	@keyframes after-glow {
		0% {
			border-top: 16px solid #00a4a2
		}

		100% {
			border-top: 16px solid #00fffc
		}
	}

	@keyframes circle1 {
		0% {
			-moz-transform: rotate(0deg);
			-ms-transform: rotate(0deg);
			-webkit-transform: rotate(0deg);
			transform: rotate(0deg)
		}

		100% {
			-moz-transform: rotate(360deg);
			-ms-transform: rotate(360deg);
			-webkit-transform: rotate(360deg);
			transform: rotate(360deg)
		}
	}
</style>
